module.exports = {
	"优惠通用算法": function(cash_info, 优惠info, TYPE_MAP) {
		var current_cash = cash_info.current_cash;
		var sou_cash = cash_info.sou_cash;

		if (优惠info.type === TYPE_MAP.满减) {
			var full_cash = +优惠info.config.full_cash;
			var cut_cash = +优惠info.config.cut_cash;
			if (full_cash <= sou_cash) {
				current_cash -= cut_cash;
			}
		} else if (优惠info.type === TYPE_MAP.打折) {
			var discount = +优惠info.config.discount;
			if (discount) {
				current_cash -= current_cash * discount;
			}
		} else if (优惠info.type === TYPE_MAP.现金抵用) {
			var directly_cut_cash = +优惠info.config.directly_cut_cash;
			if (directly_cut_cash) {
				current_cash -= directly_cut_cash;
			}
		}
		return current_cash;
	}
}